import 'package:flutter/material.dart';

class AppTitle extends StatefulWidget {
  final String title;
  final String? icon;
  final TextStyle? textStyle;

  const AppTitle({super.key, required this.title, this.icon, this.textStyle});

  @override
  State<AppTitle> createState() => _AppTitleState();
}

class _AppTitleState extends State<AppTitle> {
  @override
  Widget build(BuildContext context) {
    return Row(
      children: [

        widget.icon != null
            ? Image.asset(widget.icon!, width: 16)
            : Container(),
        const SizedBox(width: 4),
     Text(widget.title,
              maxLines: 1,
              overflow: TextOverflow.ellipsis,
              style: widget.textStyle != null
                  ? widget.textStyle
                  : TextStyle(fontSize: 16, fontWeight: FontWeight.w600)),
      ],
    );
  }
}
